package com.pafcio.dde.server;

import com.neva.DdeServerTransactionEvent;
import com.neva.DdeServerTransactionEventListener;
import com.neva.DdeServerTransactionRejectedException;

public class DataGenerationStrategyEventListener implements DdeServerTransactionEventListener {

	private final DataGenerationStrategy dataGenerationStrategy;

	public DataGenerationStrategyEventListener(DataGenerationStrategy dataGenerationStrategy){
		this.dataGenerationStrategy = dataGenerationStrategy;		
	}
	
	@Override
	public void onAdvReq(DdeServerTransactionEvent requestEvent) throws DdeServerTransactionRejectedException {
		requestEvent.setRequestedData(dataGenerationStrategy.getRequestedData(requestEvent));
	}

	@Override
	public void onAdvStart(DdeServerTransactionEvent arg0) throws DdeServerTransactionRejectedException {

	}

	@Override
	public void onAdvStop(DdeServerTransactionEvent arg0) throws DdeServerTransactionRejectedException {

	}

	@Override
	public void onException(DdeServerTransactionEvent arg0) {

	}

	@Override
	public void onExecute(DdeServerTransactionEvent arg0) throws DdeServerTransactionRejectedException {

	}

	@Override
	public void onPoke(DdeServerTransactionEvent arg0) throws DdeServerTransactionRejectedException {

	}

	@Override
	public void onRequest(DdeServerTransactionEvent arg0) throws DdeServerTransactionRejectedException {

	}
}
